// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#include <PyRenderingAttributes.h>
#include <ObserverToCallback.h>
#include <stdio.h>
#include <Py2and3Support.h>
#include <ColorAttribute.h>

// ****************************************************************************
// Module: PyRenderingAttributes
//
// Purpose:
//   This class contains special rendering attributes like antialiasing and stero settings.
//
// Note:       Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation:   omitted
//
// ****************************************************************************

//
// This struct contains the Python type information and a RenderingAttributes.
//
struct RenderingAttributesObject
{
    PyObject_HEAD
    RenderingAttributes *data;
    bool        owns;
    PyObject   *parent;
};

//
// Internal prototypes
//
static PyObject *NewRenderingAttributes(int);
std::string
PyRenderingAttributes_ToString(const RenderingAttributes *atts, const char *prefix, const bool forLogging)
{
    std::string str;
    char tmpStr[1000];

    if(atts->GetAntialiasing())
        snprintf(tmpStr, 1000, "%santialiasing = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%santialiasing = 0\n", prefix);
    str += tmpStr;
    if(atts->GetOrderComposite())
        snprintf(tmpStr, 1000, "%sorderComposite = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sorderComposite = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sdepthCompositeThreads = %d\n", prefix, atts->GetDepthCompositeThreads());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sdepthCompositeBlocking = %d\n", prefix, atts->GetDepthCompositeBlocking());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%salphaCompositeThreads = %d\n", prefix, atts->GetAlphaCompositeThreads());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%salphaCompositeBlocking = %d\n", prefix, atts->GetAlphaCompositeBlocking());
    str += tmpStr;
    if(atts->GetDepthPeeling())
        snprintf(tmpStr, 1000, "%sdepthPeeling = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdepthPeeling = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%socclusionRatio = %g\n", prefix, atts->GetOcclusionRatio());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%snumberOfPeels = %d\n", prefix, atts->GetNumberOfPeels());
    str += tmpStr;
    if(atts->GetMultiresolutionMode())
        snprintf(tmpStr, 1000, "%smultiresolutionMode = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%smultiresolutionMode = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%smultiresolutionCellSize = %g\n", prefix, atts->GetMultiresolutionCellSize());
    str += tmpStr;
    const char *geometryRepresentation_names = "Surfaces, Wireframe, Points";
    switch (atts->GetGeometryRepresentation())
    {
      case RenderingAttributes::Surfaces:
          snprintf(tmpStr, 1000, "%sgeometryRepresentation = %sSurfaces  # %s\n", prefix, prefix, geometryRepresentation_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Wireframe:
          snprintf(tmpStr, 1000, "%sgeometryRepresentation = %sWireframe  # %s\n", prefix, prefix, geometryRepresentation_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Points:
          snprintf(tmpStr, 1000, "%sgeometryRepresentation = %sPoints  # %s\n", prefix, prefix, geometryRepresentation_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetStereoRendering())
        snprintf(tmpStr, 1000, "%sstereoRendering = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sstereoRendering = 0\n", prefix);
    str += tmpStr;
    const char *stereoType_names = "RedBlue, Interlaced, CrystalEyes, RedGreen";
    switch (atts->GetStereoType())
    {
      case RenderingAttributes::RedBlue:
          snprintf(tmpStr, 1000, "%sstereoType = %sRedBlue  # %s\n", prefix, prefix, stereoType_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Interlaced:
          snprintf(tmpStr, 1000, "%sstereoType = %sInterlaced  # %s\n", prefix, prefix, stereoType_names);
          str += tmpStr;
          break;
      case RenderingAttributes::CrystalEyes:
          snprintf(tmpStr, 1000, "%sstereoType = %sCrystalEyes  # %s\n", prefix, prefix, stereoType_names);
          str += tmpStr;
          break;
      case RenderingAttributes::RedGreen:
          snprintf(tmpStr, 1000, "%sstereoType = %sRedGreen  # %s\n", prefix, prefix, stereoType_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetNotifyForEachRender())
        snprintf(tmpStr, 1000, "%snotifyForEachRender = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%snotifyForEachRender = 0\n", prefix);
    str += tmpStr;
    const char *scalableActivationMode_names = "Never, Always, Auto";
    switch (atts->GetScalableActivationMode())
    {
      case RenderingAttributes::Never:
          snprintf(tmpStr, 1000, "%sscalableActivationMode = %sNever  # %s\n", prefix, prefix, scalableActivationMode_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Always:
          snprintf(tmpStr, 1000, "%sscalableActivationMode = %sAlways  # %s\n", prefix, prefix, scalableActivationMode_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Auto:
          snprintf(tmpStr, 1000, "%sscalableActivationMode = %sAuto  # %s\n", prefix, prefix, scalableActivationMode_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%sscalableAutoThreshold = %d\n", prefix, atts->GetScalableAutoThreshold());
    str += tmpStr;
    if(atts->GetSpecularFlag())
        snprintf(tmpStr, 1000, "%sspecularFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sspecularFlag = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sspecularCoeff = %g\n", prefix, atts->GetSpecularCoeff());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sspecularPower = %g\n", prefix, atts->GetSpecularPower());
    str += tmpStr;
    const unsigned char *specularColor = atts->GetSpecularColor().GetColor();
    snprintf(tmpStr, 1000, "%sspecularColor = (%d, %d, %d, %d)\n", prefix, int(specularColor[0]), int(specularColor[1]), int(specularColor[2]), int(specularColor[3]));
    str += tmpStr;
    if(atts->GetDoShadowing())
        snprintf(tmpStr, 1000, "%sdoShadowing = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdoShadowing = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sshadowStrength = %g\n", prefix, atts->GetShadowStrength());
    str += tmpStr;
    if(atts->GetDoDepthCueing())
        snprintf(tmpStr, 1000, "%sdoDepthCueing = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdoDepthCueing = 0\n", prefix);
    str += tmpStr;
    if(atts->GetDepthCueingAutomatic())
        snprintf(tmpStr, 1000, "%sdepthCueingAutomatic = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sdepthCueingAutomatic = 0\n", prefix);
    str += tmpStr;
    {   const double *startCuePoint = atts->GetStartCuePoint();
        snprintf(tmpStr, 1000, "%sstartCuePoint = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 3; ++i)
        {
            snprintf(tmpStr, 1000, "%g", startCuePoint[i]);
            str += tmpStr;
            if(i < 2)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    {   const double *endCuePoint = atts->GetEndCuePoint();
        snprintf(tmpStr, 1000, "%sendCuePoint = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 3; ++i)
        {
            snprintf(tmpStr, 1000, "%g", endCuePoint[i]);
            str += tmpStr;
            if(i < 2)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    const char *compressionActivationMode_names = "Never, Always, Auto";
    switch (atts->GetCompressionActivationMode())
    {
      case RenderingAttributes::Never:
          snprintf(tmpStr, 1000, "%scompressionActivationMode = %sNever  # %s\n", prefix, prefix, compressionActivationMode_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Always:
          snprintf(tmpStr, 1000, "%scompressionActivationMode = %sAlways  # %s\n", prefix, prefix, compressionActivationMode_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Auto:
          snprintf(tmpStr, 1000, "%scompressionActivationMode = %sAuto  # %s\n", prefix, prefix, compressionActivationMode_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    if(atts->GetColorTexturingFlag())
        snprintf(tmpStr, 1000, "%scolorTexturingFlag = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%scolorTexturingFlag = 0\n", prefix);
    str += tmpStr;
    const char *compactDomainsActivationMode_names = "Never, Always, Auto";
    switch (atts->GetCompactDomainsActivationMode())
    {
      case RenderingAttributes::Never:
          snprintf(tmpStr, 1000, "%scompactDomainsActivationMode = %sNever  # %s\n", prefix, prefix, compactDomainsActivationMode_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Always:
          snprintf(tmpStr, 1000, "%scompactDomainsActivationMode = %sAlways  # %s\n", prefix, prefix, compactDomainsActivationMode_names);
          str += tmpStr;
          break;
      case RenderingAttributes::Auto:
          snprintf(tmpStr, 1000, "%scompactDomainsActivationMode = %sAuto  # %s\n", prefix, prefix, compactDomainsActivationMode_names);
          str += tmpStr;
          break;
      default:
          break;
    }

    snprintf(tmpStr, 1000, "%scompactDomainsAutoThreshold = %d\n", prefix, atts->GetCompactDomainsAutoThreshold());
    str += tmpStr;
    if(atts->GetOsprayRendering())
        snprintf(tmpStr, 1000, "%sosprayRendering = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sosprayRendering = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sospraySPP = %d\n", prefix, atts->GetOspraySPP());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sosprayAO = %d\n", prefix, atts->GetOsprayAO());
    str += tmpStr;
    if(atts->GetOsprayShadows())
        snprintf(tmpStr, 1000, "%sosprayShadows = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sosprayShadows = 0\n", prefix);
    str += tmpStr;
    return str;
}

static PyObject *
RenderingAttributes_Notify(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    obj->data->Notify();
    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_SetAntialiasing(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the antialiasing in the object.
    obj->data->SetAntialiasing(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetAntialiasing(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetAntialiasing()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetOrderComposite(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the orderComposite in the object.
    obj->data->SetOrderComposite(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetOrderComposite(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOrderComposite()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetDepthCompositeThreads(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the depthCompositeThreads in the object.
    obj->data->SetDepthCompositeThreads(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetDepthCompositeThreads(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetDepthCompositeThreads()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetDepthCompositeBlocking(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the depthCompositeBlocking in the object.
    obj->data->SetDepthCompositeBlocking(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetDepthCompositeBlocking(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetDepthCompositeBlocking()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetAlphaCompositeThreads(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the alphaCompositeThreads in the object.
    obj->data->SetAlphaCompositeThreads(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetAlphaCompositeThreads(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetAlphaCompositeThreads()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetAlphaCompositeBlocking(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the alphaCompositeBlocking in the object.
    obj->data->SetAlphaCompositeBlocking(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetAlphaCompositeBlocking(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetAlphaCompositeBlocking()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetDepthPeeling(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the depthPeeling in the object.
    obj->data->SetDepthPeeling(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetDepthPeeling(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDepthPeeling()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetOcclusionRatio(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the occlusionRatio in the object.
    obj->data->SetOcclusionRatio(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetOcclusionRatio(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetOcclusionRatio());
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetNumberOfPeels(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the numberOfPeels in the object.
    obj->data->SetNumberOfPeels(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetNumberOfPeels(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetNumberOfPeels()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetMultiresolutionMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the multiresolutionMode in the object.
    obj->data->SetMultiresolutionMode(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetMultiresolutionMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetMultiresolutionMode()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetMultiresolutionCellSize(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the multiresolutionCellSize in the object.
    obj->data->SetMultiresolutionCellSize(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetMultiresolutionCellSize(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetMultiresolutionCellSize()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetGeometryRepresentation(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid geometryRepresentation value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Surfaces";
        ss << ", Wireframe";
        ss << ", Points";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the geometryRepresentation in the object.
    obj->data->SetGeometryRepresentation(RenderingAttributes::GeometryRepresentation(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetGeometryRepresentation(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetGeometryRepresentation()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetStereoRendering(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the stereoRendering in the object.
    obj->data->SetStereoRendering(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetStereoRendering(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetStereoRendering()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetStereoType(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 4)
    {
        std::stringstream ss;
        ss << "An invalid stereoType value was given." << std::endl;
        ss << "Valid values are in the range [0,3]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " RedBlue";
        ss << ", Interlaced";
        ss << ", CrystalEyes";
        ss << ", RedGreen";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the stereoType in the object.
    obj->data->SetStereoType(RenderingAttributes::StereoTypes(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetStereoType(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetStereoType()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetNotifyForEachRender(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the notifyForEachRender in the object.
    obj->data->SetNotifyForEachRender(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetNotifyForEachRender(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetNotifyForEachRender()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetScalableActivationMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid scalableActivationMode value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Never";
        ss << ", Always";
        ss << ", Auto";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the scalableActivationMode in the object.
    obj->data->SetScalableActivationMode(RenderingAttributes::TriStateMode(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetScalableActivationMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetScalableActivationMode()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetScalableAutoThreshold(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the scalableAutoThreshold in the object.
    obj->data->SetScalableAutoThreshold(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetScalableAutoThreshold(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetScalableAutoThreshold()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetSpecularFlag(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the specularFlag in the object.
    obj->data->SetSpecularFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetSpecularFlag(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetSpecularFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetSpecularCoeff(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the specularCoeff in the object.
    obj->data->SetSpecularCoeff(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetSpecularCoeff(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetSpecularCoeff()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetSpecularPower(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the specularPower in the object.
    obj->data->SetSpecularPower(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetSpecularPower(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetSpecularPower()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetSpecularColor(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    int c[4];
    if(!PyArg_ParseTuple(args, "iiii", &c[0], &c[1], &c[2], &c[3]))
    {
        c[3] = 255;
        if(!PyArg_ParseTuple(args, "iii", &c[0], &c[1], &c[2]))
        {
            double dr, dg, db, da;
            if(PyArg_ParseTuple(args, "dddd", &dr, &dg, &db, &da))
            {
                c[0] = int(dr);
                c[1] = int(dg);
                c[2] = int(db);
                c[3] = int(da);
            }
            else if(PyArg_ParseTuple(args, "ddd", &dr, &dg, &db))
            {
                c[0] = int(dr);
                c[1] = int(dg);
                c[2] = int(db);
                c[3] = 255;
            }
            else
            {
                PyObject *tuple = NULL;
                if(!PyArg_ParseTuple(args, "O", &tuple))
                    return NULL;

                if(!PyTuple_Check(tuple))
                    return NULL;

                // Make sure that the tuple is the right size.
                if(PyTuple_Size(tuple) < 3 || PyTuple_Size(tuple) > 4)
                    return NULL;

                // Make sure that all elements in the tuple are ints.
                for(int i = 0; i < PyTuple_Size(tuple); ++i)
                {
                    PyObject *item = PyTuple_GET_ITEM(tuple, i);
                    if(PyInt_Check(item))
                        c[i] = int(PyInt_AS_LONG(PyTuple_GET_ITEM(tuple, i)));
                    else if(PyFloat_Check(item))
                        c[i] = int(PyFloat_AS_DOUBLE(PyTuple_GET_ITEM(tuple, i)));
                    else
                        return NULL;
                }
            }
        }
        PyErr_Clear();
    }

    // Set the specularColor in the object.
    ColorAttribute ca(c[0], c[1], c[2], c[3]);
    obj->data->SetSpecularColor(ca);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetSpecularColor(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the specularColor.
    PyObject *retval = PyTuple_New(4);
    const unsigned char *specularColor = obj->data->GetSpecularColor().GetColor();
    PyTuple_SET_ITEM(retval, 0, PyInt_FromLong(long(specularColor[0])));
    PyTuple_SET_ITEM(retval, 1, PyInt_FromLong(long(specularColor[1])));
    PyTuple_SET_ITEM(retval, 2, PyInt_FromLong(long(specularColor[2])));
    PyTuple_SET_ITEM(retval, 3, PyInt_FromLong(long(specularColor[3])));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetDoShadowing(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the doShadowing in the object.
    obj->data->SetDoShadowing(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetDoShadowing(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDoShadowing()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetShadowStrength(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    double cval = double(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ double");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ double");
    }

    Py_XDECREF(packaged_args);

    // Set the shadowStrength in the object.
    obj->data->SetShadowStrength(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetShadowStrength(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(obj->data->GetShadowStrength());
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetDoDepthCueing(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the doDepthCueing in the object.
    obj->data->SetDoDepthCueing(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetDoDepthCueing(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDoDepthCueing()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetDepthCueingAutomatic(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the depthCueingAutomatic in the object.
    obj->data->SetDepthCueingAutomatic(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetDepthCueingAutomatic(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetDepthCueingAutomatic()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetStartCuePoint(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;
    double *vals = obj->data->GetStartCuePoint();

    if (!PySequence_Check(args) || PyUnicode_Check(args))
        return PyErr_Format(PyExc_TypeError, "Expecting a sequence of numeric args");

    // break open args seq. if we think it matches this API's needs
    if (PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PySequence_Check(packaged_args) && !PyUnicode_Check(packaged_args) &&
            PySequence_Size(packaged_args) == 3)
            args = packaged_args;
    }

    if (PySequence_Size(args) != 3)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "Expecting 3 numeric args");
    }

    for (Py_ssize_t i = 0; i < PySequence_Size(args); i++)
    {
        PyObject *item = PySequence_GetItem(args, i);

        if (!PyNumber_Check(item))
        {
            Py_DECREF(item);
            Py_XDECREF(packaged_args);
            return PyErr_Format(PyExc_TypeError, "arg %d is not a number type", (int) i);
        }

        double val = PyFloat_AsDouble(item);
        double cval = double(val);

        if (val == -1 && PyErr_Occurred())
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            PyErr_Clear();
            return PyErr_Format(PyExc_TypeError, "arg %d not interpretable as C++ double", (int) i);
        }
        if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            return PyErr_Format(PyExc_ValueError, "arg %d not interpretable as C++ double", (int) i);
        }
        Py_DECREF(item);

        vals[i] = cval;
    }

    Py_XDECREF(packaged_args);

    // Mark the startCuePoint in the object as modified.
    obj->data->SelectStartCuePoint();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetStartCuePoint(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the startCuePoint.
    PyObject *retval = PyTuple_New(3);
    const double *startCuePoint = obj->data->GetStartCuePoint();
    for(int i = 0; i < 3; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(startCuePoint[i]));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetEndCuePoint(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;
    double *vals = obj->data->GetEndCuePoint();

    if (!PySequence_Check(args) || PyUnicode_Check(args))
        return PyErr_Format(PyExc_TypeError, "Expecting a sequence of numeric args");

    // break open args seq. if we think it matches this API's needs
    if (PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PySequence_Check(packaged_args) && !PyUnicode_Check(packaged_args) &&
            PySequence_Size(packaged_args) == 3)
            args = packaged_args;
    }

    if (PySequence_Size(args) != 3)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "Expecting 3 numeric args");
    }

    for (Py_ssize_t i = 0; i < PySequence_Size(args); i++)
    {
        PyObject *item = PySequence_GetItem(args, i);

        if (!PyNumber_Check(item))
        {
            Py_DECREF(item);
            Py_XDECREF(packaged_args);
            return PyErr_Format(PyExc_TypeError, "arg %d is not a number type", (int) i);
        }

        double val = PyFloat_AsDouble(item);
        double cval = double(val);

        if (val == -1 && PyErr_Occurred())
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            PyErr_Clear();
            return PyErr_Format(PyExc_TypeError, "arg %d not interpretable as C++ double", (int) i);
        }
        if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            return PyErr_Format(PyExc_ValueError, "arg %d not interpretable as C++ double", (int) i);
        }
        Py_DECREF(item);

        vals[i] = cval;
    }

    Py_XDECREF(packaged_args);

    // Mark the endCuePoint in the object as modified.
    obj->data->SelectEndCuePoint();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetEndCuePoint(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the endCuePoint.
    PyObject *retval = PyTuple_New(3);
    const double *endCuePoint = obj->data->GetEndCuePoint();
    for(int i = 0; i < 3; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(endCuePoint[i]));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetCompressionActivationMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid compressionActivationMode value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Never";
        ss << ", Always";
        ss << ", Auto";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the compressionActivationMode in the object.
    obj->data->SetCompressionActivationMode(RenderingAttributes::TriStateMode(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetCompressionActivationMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetCompressionActivationMode()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetColorTexturingFlag(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the colorTexturingFlag in the object.
    obj->data->SetColorTexturingFlag(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetColorTexturingFlag(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetColorTexturingFlag()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetCompactDomainsActivationMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if ((val == -1 && PyErr_Occurred()) || long(cval) != val)
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }

    if (cval < 0 || cval >= 3)
    {
        std::stringstream ss;
        ss << "An invalid compactDomainsActivationMode value was given." << std::endl;
        ss << "Valid values are in the range [0,2]." << std::endl;
        ss << "You can also use the following symbolic names:";
        ss << " Never";
        ss << ", Always";
        ss << ", Auto";
        return PyErr_Format(PyExc_ValueError, ss.str().c_str());
    }

    Py_XDECREF(packaged_args);

    // Set the compactDomainsActivationMode in the object.
    obj->data->SetCompactDomainsActivationMode(RenderingAttributes::TriStateMode(cval));

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetCompactDomainsActivationMode(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetCompactDomainsActivationMode()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetCompactDomainsAutoThreshold(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the compactDomainsAutoThreshold in the object.
    obj->data->SetCompactDomainsAutoThreshold(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetCompactDomainsAutoThreshold(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetCompactDomainsAutoThreshold()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetOsprayRendering(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the osprayRendering in the object.
    obj->data->SetOsprayRendering(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetOsprayRendering(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOsprayRendering()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetOspraySPP(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the ospraySPP in the object.
    obj->data->SetOspraySPP(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetOspraySPP(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOspraySPP()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetOsprayAO(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    int cval = int(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ int");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ int");
    }

    Py_XDECREF(packaged_args);

    // Set the osprayAO in the object.
    obj->data->SetOsprayAO(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetOsprayAO(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(long(obj->data->GetOsprayAO()));
    return retval;
}

/*static*/ PyObject *
RenderingAttributes_SetOsprayShadows(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the osprayShadows in the object.
    obj->data->SetOsprayShadows(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RenderingAttributes_GetOsprayShadows(PyObject *self, PyObject *args)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetOsprayShadows()?1L:0L);
    return retval;
}



PyMethodDef PyRenderingAttributes_methods[RENDERINGATTRIBUTES_NMETH] = {
    {"Notify", RenderingAttributes_Notify, METH_VARARGS},
    {"SetAntialiasing", RenderingAttributes_SetAntialiasing, METH_VARARGS},
    {"GetAntialiasing", RenderingAttributes_GetAntialiasing, METH_VARARGS},
    {"SetOrderComposite", RenderingAttributes_SetOrderComposite, METH_VARARGS},
    {"GetOrderComposite", RenderingAttributes_GetOrderComposite, METH_VARARGS},
    {"SetDepthCompositeThreads", RenderingAttributes_SetDepthCompositeThreads, METH_VARARGS},
    {"GetDepthCompositeThreads", RenderingAttributes_GetDepthCompositeThreads, METH_VARARGS},
    {"SetDepthCompositeBlocking", RenderingAttributes_SetDepthCompositeBlocking, METH_VARARGS},
    {"GetDepthCompositeBlocking", RenderingAttributes_GetDepthCompositeBlocking, METH_VARARGS},
    {"SetAlphaCompositeThreads", RenderingAttributes_SetAlphaCompositeThreads, METH_VARARGS},
    {"GetAlphaCompositeThreads", RenderingAttributes_GetAlphaCompositeThreads, METH_VARARGS},
    {"SetAlphaCompositeBlocking", RenderingAttributes_SetAlphaCompositeBlocking, METH_VARARGS},
    {"GetAlphaCompositeBlocking", RenderingAttributes_GetAlphaCompositeBlocking, METH_VARARGS},
    {"SetDepthPeeling", RenderingAttributes_SetDepthPeeling, METH_VARARGS},
    {"GetDepthPeeling", RenderingAttributes_GetDepthPeeling, METH_VARARGS},
    {"SetOcclusionRatio", RenderingAttributes_SetOcclusionRatio, METH_VARARGS},
    {"GetOcclusionRatio", RenderingAttributes_GetOcclusionRatio, METH_VARARGS},
    {"SetNumberOfPeels", RenderingAttributes_SetNumberOfPeels, METH_VARARGS},
    {"GetNumberOfPeels", RenderingAttributes_GetNumberOfPeels, METH_VARARGS},
    {"SetMultiresolutionMode", RenderingAttributes_SetMultiresolutionMode, METH_VARARGS},
    {"GetMultiresolutionMode", RenderingAttributes_GetMultiresolutionMode, METH_VARARGS},
    {"SetMultiresolutionCellSize", RenderingAttributes_SetMultiresolutionCellSize, METH_VARARGS},
    {"GetMultiresolutionCellSize", RenderingAttributes_GetMultiresolutionCellSize, METH_VARARGS},
    {"SetGeometryRepresentation", RenderingAttributes_SetGeometryRepresentation, METH_VARARGS},
    {"GetGeometryRepresentation", RenderingAttributes_GetGeometryRepresentation, METH_VARARGS},
    {"SetStereoRendering", RenderingAttributes_SetStereoRendering, METH_VARARGS},
    {"GetStereoRendering", RenderingAttributes_GetStereoRendering, METH_VARARGS},
    {"SetStereoType", RenderingAttributes_SetStereoType, METH_VARARGS},
    {"GetStereoType", RenderingAttributes_GetStereoType, METH_VARARGS},
    {"SetNotifyForEachRender", RenderingAttributes_SetNotifyForEachRender, METH_VARARGS},
    {"GetNotifyForEachRender", RenderingAttributes_GetNotifyForEachRender, METH_VARARGS},
    {"SetScalableActivationMode", RenderingAttributes_SetScalableActivationMode, METH_VARARGS},
    {"GetScalableActivationMode", RenderingAttributes_GetScalableActivationMode, METH_VARARGS},
    {"SetScalableAutoThreshold", RenderingAttributes_SetScalableAutoThreshold, METH_VARARGS},
    {"GetScalableAutoThreshold", RenderingAttributes_GetScalableAutoThreshold, METH_VARARGS},
    {"SetSpecularFlag", RenderingAttributes_SetSpecularFlag, METH_VARARGS},
    {"GetSpecularFlag", RenderingAttributes_GetSpecularFlag, METH_VARARGS},
    {"SetSpecularCoeff", RenderingAttributes_SetSpecularCoeff, METH_VARARGS},
    {"GetSpecularCoeff", RenderingAttributes_GetSpecularCoeff, METH_VARARGS},
    {"SetSpecularPower", RenderingAttributes_SetSpecularPower, METH_VARARGS},
    {"GetSpecularPower", RenderingAttributes_GetSpecularPower, METH_VARARGS},
    {"SetSpecularColor", RenderingAttributes_SetSpecularColor, METH_VARARGS},
    {"GetSpecularColor", RenderingAttributes_GetSpecularColor, METH_VARARGS},
    {"SetDoShadowing", RenderingAttributes_SetDoShadowing, METH_VARARGS},
    {"GetDoShadowing", RenderingAttributes_GetDoShadowing, METH_VARARGS},
    {"SetShadowStrength", RenderingAttributes_SetShadowStrength, METH_VARARGS},
    {"GetShadowStrength", RenderingAttributes_GetShadowStrength, METH_VARARGS},
    {"SetDoDepthCueing", RenderingAttributes_SetDoDepthCueing, METH_VARARGS},
    {"GetDoDepthCueing", RenderingAttributes_GetDoDepthCueing, METH_VARARGS},
    {"SetDepthCueingAutomatic", RenderingAttributes_SetDepthCueingAutomatic, METH_VARARGS},
    {"GetDepthCueingAutomatic", RenderingAttributes_GetDepthCueingAutomatic, METH_VARARGS},
    {"SetStartCuePoint", RenderingAttributes_SetStartCuePoint, METH_VARARGS},
    {"GetStartCuePoint", RenderingAttributes_GetStartCuePoint, METH_VARARGS},
    {"SetEndCuePoint", RenderingAttributes_SetEndCuePoint, METH_VARARGS},
    {"GetEndCuePoint", RenderingAttributes_GetEndCuePoint, METH_VARARGS},
    {"SetCompressionActivationMode", RenderingAttributes_SetCompressionActivationMode, METH_VARARGS},
    {"GetCompressionActivationMode", RenderingAttributes_GetCompressionActivationMode, METH_VARARGS},
    {"SetColorTexturingFlag", RenderingAttributes_SetColorTexturingFlag, METH_VARARGS},
    {"GetColorTexturingFlag", RenderingAttributes_GetColorTexturingFlag, METH_VARARGS},
    {"SetCompactDomainsActivationMode", RenderingAttributes_SetCompactDomainsActivationMode, METH_VARARGS},
    {"GetCompactDomainsActivationMode", RenderingAttributes_GetCompactDomainsActivationMode, METH_VARARGS},
    {"SetCompactDomainsAutoThreshold", RenderingAttributes_SetCompactDomainsAutoThreshold, METH_VARARGS},
    {"GetCompactDomainsAutoThreshold", RenderingAttributes_GetCompactDomainsAutoThreshold, METH_VARARGS},
    {"SetOsprayRendering", RenderingAttributes_SetOsprayRendering, METH_VARARGS},
    {"GetOsprayRendering", RenderingAttributes_GetOsprayRendering, METH_VARARGS},
    {"SetOspraySPP", RenderingAttributes_SetOspraySPP, METH_VARARGS},
    {"GetOspraySPP", RenderingAttributes_GetOspraySPP, METH_VARARGS},
    {"SetOsprayAO", RenderingAttributes_SetOsprayAO, METH_VARARGS},
    {"GetOsprayAO", RenderingAttributes_GetOsprayAO, METH_VARARGS},
    {"SetOsprayShadows", RenderingAttributes_SetOsprayShadows, METH_VARARGS},
    {"GetOsprayShadows", RenderingAttributes_GetOsprayShadows, METH_VARARGS},
    {NULL, NULL}
};

//
// Type functions
//

static void
RenderingAttributes_dealloc(PyObject *v)
{
   RenderingAttributesObject *obj = (RenderingAttributesObject *)v;
   if(obj->parent != 0)
       Py_DECREF(obj->parent);
   if(obj->owns)
       delete obj->data;
}

static PyObject *RenderingAttributes_richcompare(PyObject *self, PyObject *other, int op);
PyObject *
PyRenderingAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "antialiasing") == 0)
        return RenderingAttributes_GetAntialiasing(self, NULL);
    if(strcmp(name, "orderComposite") == 0)
        return RenderingAttributes_GetOrderComposite(self, NULL);
    if(strcmp(name, "depthCompositeThreads") == 0)
        return RenderingAttributes_GetDepthCompositeThreads(self, NULL);
    if(strcmp(name, "depthCompositeBlocking") == 0)
        return RenderingAttributes_GetDepthCompositeBlocking(self, NULL);
    if(strcmp(name, "alphaCompositeThreads") == 0)
        return RenderingAttributes_GetAlphaCompositeThreads(self, NULL);
    if(strcmp(name, "alphaCompositeBlocking") == 0)
        return RenderingAttributes_GetAlphaCompositeBlocking(self, NULL);
    if(strcmp(name, "depthPeeling") == 0)
        return RenderingAttributes_GetDepthPeeling(self, NULL);
    if(strcmp(name, "occlusionRatio") == 0)
        return RenderingAttributes_GetOcclusionRatio(self, NULL);
    if(strcmp(name, "numberOfPeels") == 0)
        return RenderingAttributes_GetNumberOfPeels(self, NULL);
    if(strcmp(name, "multiresolutionMode") == 0)
        return RenderingAttributes_GetMultiresolutionMode(self, NULL);
    if(strcmp(name, "multiresolutionCellSize") == 0)
        return RenderingAttributes_GetMultiresolutionCellSize(self, NULL);
    if(strcmp(name, "geometryRepresentation") == 0)
        return RenderingAttributes_GetGeometryRepresentation(self, NULL);
    if(strcmp(name, "Surfaces") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Surfaces));
    if(strcmp(name, "Wireframe") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Wireframe));
    if(strcmp(name, "Points") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Points));

    if(strcmp(name, "stereoRendering") == 0)
        return RenderingAttributes_GetStereoRendering(self, NULL);
    if(strcmp(name, "stereoType") == 0)
        return RenderingAttributes_GetStereoType(self, NULL);
    if(strcmp(name, "RedBlue") == 0)
        return PyInt_FromLong(long(RenderingAttributes::RedBlue));
    if(strcmp(name, "Interlaced") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Interlaced));
    if(strcmp(name, "CrystalEyes") == 0)
        return PyInt_FromLong(long(RenderingAttributes::CrystalEyes));
    if(strcmp(name, "RedGreen") == 0)
        return PyInt_FromLong(long(RenderingAttributes::RedGreen));

    if(strcmp(name, "notifyForEachRender") == 0)
        return RenderingAttributes_GetNotifyForEachRender(self, NULL);
    if(strcmp(name, "scalableActivationMode") == 0)
        return RenderingAttributes_GetScalableActivationMode(self, NULL);
    if(strcmp(name, "Never") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Never));
    if(strcmp(name, "Always") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Always));
    if(strcmp(name, "Auto") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Auto));

    if(strcmp(name, "scalableAutoThreshold") == 0)
        return RenderingAttributes_GetScalableAutoThreshold(self, NULL);
    if(strcmp(name, "specularFlag") == 0)
        return RenderingAttributes_GetSpecularFlag(self, NULL);
    if(strcmp(name, "specularCoeff") == 0)
        return RenderingAttributes_GetSpecularCoeff(self, NULL);
    if(strcmp(name, "specularPower") == 0)
        return RenderingAttributes_GetSpecularPower(self, NULL);
    if(strcmp(name, "specularColor") == 0)
        return RenderingAttributes_GetSpecularColor(self, NULL);
    if(strcmp(name, "doShadowing") == 0)
        return RenderingAttributes_GetDoShadowing(self, NULL);
    if(strcmp(name, "shadowStrength") == 0)
        return RenderingAttributes_GetShadowStrength(self, NULL);
    if(strcmp(name, "doDepthCueing") == 0)
        return RenderingAttributes_GetDoDepthCueing(self, NULL);
    if(strcmp(name, "depthCueingAutomatic") == 0)
        return RenderingAttributes_GetDepthCueingAutomatic(self, NULL);
    if(strcmp(name, "startCuePoint") == 0)
        return RenderingAttributes_GetStartCuePoint(self, NULL);
    if(strcmp(name, "endCuePoint") == 0)
        return RenderingAttributes_GetEndCuePoint(self, NULL);
    if(strcmp(name, "compressionActivationMode") == 0)
        return RenderingAttributes_GetCompressionActivationMode(self, NULL);
    if(strcmp(name, "Never") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Never));
    if(strcmp(name, "Always") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Always));
    if(strcmp(name, "Auto") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Auto));

    if(strcmp(name, "colorTexturingFlag") == 0)
        return RenderingAttributes_GetColorTexturingFlag(self, NULL);
    if(strcmp(name, "compactDomainsActivationMode") == 0)
        return RenderingAttributes_GetCompactDomainsActivationMode(self, NULL);
    if(strcmp(name, "Never") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Never));
    if(strcmp(name, "Always") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Always));
    if(strcmp(name, "Auto") == 0)
        return PyInt_FromLong(long(RenderingAttributes::Auto));

    if(strcmp(name, "compactDomainsAutoThreshold") == 0)
        return RenderingAttributes_GetCompactDomainsAutoThreshold(self, NULL);
    if(strcmp(name, "osprayRendering") == 0)
        return RenderingAttributes_GetOsprayRendering(self, NULL);
    if(strcmp(name, "ospraySPP") == 0)
        return RenderingAttributes_GetOspraySPP(self, NULL);
    if(strcmp(name, "osprayAO") == 0)
        return RenderingAttributes_GetOsprayAO(self, NULL);
    if(strcmp(name, "osprayShadows") == 0)
        return RenderingAttributes_GetOsprayShadows(self, NULL);


    // Add a __dict__ answer so that dir() works
    if (!strcmp(name, "__dict__"))
    {
        PyObject *result = PyDict_New();
        for (int i = 0; PyRenderingAttributes_methods[i].ml_meth; i++)
            PyDict_SetItem(result,
                PyString_FromString(PyRenderingAttributes_methods[i].ml_name),
                PyString_FromString(PyRenderingAttributes_methods[i].ml_name));
        return result;
    }

    return Py_FindMethod(PyRenderingAttributes_methods, self, name);
}

int
PyRenderingAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
    PyObject NULL_PY_OBJ;
    PyObject *obj = &NULL_PY_OBJ;

    if(strcmp(name, "antialiasing") == 0)
        obj = RenderingAttributes_SetAntialiasing(self, args);
    else if(strcmp(name, "orderComposite") == 0)
        obj = RenderingAttributes_SetOrderComposite(self, args);
    else if(strcmp(name, "depthCompositeThreads") == 0)
        obj = RenderingAttributes_SetDepthCompositeThreads(self, args);
    else if(strcmp(name, "depthCompositeBlocking") == 0)
        obj = RenderingAttributes_SetDepthCompositeBlocking(self, args);
    else if(strcmp(name, "alphaCompositeThreads") == 0)
        obj = RenderingAttributes_SetAlphaCompositeThreads(self, args);
    else if(strcmp(name, "alphaCompositeBlocking") == 0)
        obj = RenderingAttributes_SetAlphaCompositeBlocking(self, args);
    else if(strcmp(name, "depthPeeling") == 0)
        obj = RenderingAttributes_SetDepthPeeling(self, args);
    else if(strcmp(name, "occlusionRatio") == 0)
        obj = RenderingAttributes_SetOcclusionRatio(self, args);
    else if(strcmp(name, "numberOfPeels") == 0)
        obj = RenderingAttributes_SetNumberOfPeels(self, args);
    else if(strcmp(name, "multiresolutionMode") == 0)
        obj = RenderingAttributes_SetMultiresolutionMode(self, args);
    else if(strcmp(name, "multiresolutionCellSize") == 0)
        obj = RenderingAttributes_SetMultiresolutionCellSize(self, args);
    else if(strcmp(name, "geometryRepresentation") == 0)
        obj = RenderingAttributes_SetGeometryRepresentation(self, args);
    else if(strcmp(name, "stereoRendering") == 0)
        obj = RenderingAttributes_SetStereoRendering(self, args);
    else if(strcmp(name, "stereoType") == 0)
        obj = RenderingAttributes_SetStereoType(self, args);
    else if(strcmp(name, "notifyForEachRender") == 0)
        obj = RenderingAttributes_SetNotifyForEachRender(self, args);
    else if(strcmp(name, "scalableActivationMode") == 0)
        obj = RenderingAttributes_SetScalableActivationMode(self, args);
    else if(strcmp(name, "scalableAutoThreshold") == 0)
        obj = RenderingAttributes_SetScalableAutoThreshold(self, args);
    else if(strcmp(name, "specularFlag") == 0)
        obj = RenderingAttributes_SetSpecularFlag(self, args);
    else if(strcmp(name, "specularCoeff") == 0)
        obj = RenderingAttributes_SetSpecularCoeff(self, args);
    else if(strcmp(name, "specularPower") == 0)
        obj = RenderingAttributes_SetSpecularPower(self, args);
    else if(strcmp(name, "specularColor") == 0)
        obj = RenderingAttributes_SetSpecularColor(self, args);
    else if(strcmp(name, "doShadowing") == 0)
        obj = RenderingAttributes_SetDoShadowing(self, args);
    else if(strcmp(name, "shadowStrength") == 0)
        obj = RenderingAttributes_SetShadowStrength(self, args);
    else if(strcmp(name, "doDepthCueing") == 0)
        obj = RenderingAttributes_SetDoDepthCueing(self, args);
    else if(strcmp(name, "depthCueingAutomatic") == 0)
        obj = RenderingAttributes_SetDepthCueingAutomatic(self, args);
    else if(strcmp(name, "startCuePoint") == 0)
        obj = RenderingAttributes_SetStartCuePoint(self, args);
    else if(strcmp(name, "endCuePoint") == 0)
        obj = RenderingAttributes_SetEndCuePoint(self, args);
    else if(strcmp(name, "compressionActivationMode") == 0)
        obj = RenderingAttributes_SetCompressionActivationMode(self, args);
    else if(strcmp(name, "colorTexturingFlag") == 0)
        obj = RenderingAttributes_SetColorTexturingFlag(self, args);
    else if(strcmp(name, "compactDomainsActivationMode") == 0)
        obj = RenderingAttributes_SetCompactDomainsActivationMode(self, args);
    else if(strcmp(name, "compactDomainsAutoThreshold") == 0)
        obj = RenderingAttributes_SetCompactDomainsAutoThreshold(self, args);
    else if(strcmp(name, "osprayRendering") == 0)
        obj = RenderingAttributes_SetOsprayRendering(self, args);
    else if(strcmp(name, "ospraySPP") == 0)
        obj = RenderingAttributes_SetOspraySPP(self, args);
    else if(strcmp(name, "osprayAO") == 0)
        obj = RenderingAttributes_SetOsprayAO(self, args);
    else if(strcmp(name, "osprayShadows") == 0)
        obj = RenderingAttributes_SetOsprayShadows(self, args);

    if (obj != NULL && obj != &NULL_PY_OBJ)
        Py_DECREF(obj);

    if (obj == &NULL_PY_OBJ)
    {
        obj = NULL;
        PyErr_Format(PyExc_NameError, "name '%s' is not defined", name);
    }
    else if (obj == NULL && !PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "unknown problem with '%s'", name);

    return (obj != NULL) ? 0 : -1;
}

static int
RenderingAttributes_print(PyObject *v, FILE *fp, int flags)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)v;
    fprintf(fp, "%s", PyRenderingAttributes_ToString(obj->data, "",false).c_str());
    return 0;
}

PyObject *
RenderingAttributes_str(PyObject *v)
{
    RenderingAttributesObject *obj = (RenderingAttributesObject *)v;
    return PyString_FromString(PyRenderingAttributes_ToString(obj->data,"", false).c_str());
}

//
// The doc string for the class.
//
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
static const char *RenderingAttributes_Purpose = "This class contains special rendering attributes like antialiasing and stero settings.";
#else
static char *RenderingAttributes_Purpose = "This class contains special rendering attributes like antialiasing and stero settings.";
#endif

//
// Python Type Struct Def Macro from Py2and3Support.h
//
//         VISIT_PY_TYPE_OBJ( VPY_TYPE,
//                            VPY_NAME,
//                            VPY_OBJECT,
//                            VPY_DEALLOC,
//                            VPY_PRINT,
//                            VPY_GETATTR,
//                            VPY_SETATTR,
//                            VPY_STR,
//                            VPY_PURPOSE,
//                            VPY_RICHCOMP,
//                            VPY_AS_NUMBER)

//
// The type description structure
//

VISIT_PY_TYPE_OBJ(RenderingAttributesType,         \
                  "RenderingAttributes",           \
                  RenderingAttributesObject,       \
                  RenderingAttributes_dealloc,     \
                  RenderingAttributes_print,       \
                  PyRenderingAttributes_getattr,   \
                  PyRenderingAttributes_setattr,   \
                  RenderingAttributes_str,         \
                  RenderingAttributes_Purpose,     \
                  RenderingAttributes_richcompare, \
                  0); /* as_number*/

//
// Helper function for comparing.
//
static PyObject *
RenderingAttributes_richcompare(PyObject *self, PyObject *other, int op)
{
    // only compare against the same type 
    if ( Py_TYPE(self) != &RenderingAttributesType
         || Py_TYPE(other) != &RenderingAttributesType)
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

    PyObject *res = NULL;
    RenderingAttributes *a = ((RenderingAttributesObject *)self)->data;
    RenderingAttributes *b = ((RenderingAttributesObject *)other)->data;

    switch (op)
    {
       case Py_EQ:
           res = (*a == *b) ? Py_True : Py_False;
           break;
       case Py_NE:
           res = (*a != *b) ? Py_True : Py_False;
           break;
       default:
           res = Py_NotImplemented;
           break;
    }

    Py_INCREF(res);
    return res;
}

//
// Helper functions for object allocation.
//

static RenderingAttributes *defaultAtts = 0;
static RenderingAttributes *currentAtts = 0;

static PyObject *
NewRenderingAttributes(int useCurrent)
{
    RenderingAttributesObject *newObject;
    newObject = PyObject_NEW(RenderingAttributesObject, &RenderingAttributesType);
    if(newObject == NULL)
        return NULL;
    if(useCurrent && currentAtts != 0)
        newObject->data = new RenderingAttributes(*currentAtts);
    else if(defaultAtts != 0)
        newObject->data = new RenderingAttributes(*defaultAtts);
    else
        newObject->data = new RenderingAttributes;
    newObject->owns = true;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

static PyObject *
WrapRenderingAttributes(const RenderingAttributes *attr)
{
    RenderingAttributesObject *newObject;
    newObject = PyObject_NEW(RenderingAttributesObject, &RenderingAttributesType);
    if(newObject == NULL)
        return NULL;
    newObject->data = (RenderingAttributes *)attr;
    newObject->owns = false;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////

PyObject *
RenderingAttributes_new(PyObject *self, PyObject *args)
{
    int useCurrent = 0;
    if (!PyArg_ParseTuple(args, "i", &useCurrent))
    {
        if (!PyArg_ParseTuple(args, ""))
            return NULL;
        else
            PyErr_Clear();
    }

    return (PyObject *)NewRenderingAttributes(useCurrent);
}

//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef RenderingAttributesMethods[] = {
    {"RenderingAttributes", RenderingAttributes_new, METH_VARARGS},
    {NULL,      NULL}        /* Sentinel */
};

static Observer *RenderingAttributesObserver = 0;

std::string
PyRenderingAttributes_GetLogString()
{
    std::string s("RenderingAtts = RenderingAttributes()\n");
    if(currentAtts != 0)
        s += PyRenderingAttributes_ToString(currentAtts, "RenderingAtts.", true);
    return s;
}

static void
PyRenderingAttributes_CallLogRoutine(Subject *subj, void *data)
{
    typedef void (*logCallback)(const std::string &);
    logCallback cb = (logCallback)data;

    if(cb != 0)
    {
        std::string s("RenderingAtts = RenderingAttributes()\n");
        s += PyRenderingAttributes_ToString(currentAtts, "RenderingAtts.", true);
        cb(s);
    }
}

void
PyRenderingAttributes_StartUp(RenderingAttributes *subj, void *data)
{
    if(subj == 0)
        return;

    currentAtts = subj;
    PyRenderingAttributes_SetDefaults(subj);

    //
    // Create the observer that will be notified when the attributes change.
    //
    if(RenderingAttributesObserver == 0)
    {
        RenderingAttributesObserver = new ObserverToCallback(subj,
            PyRenderingAttributes_CallLogRoutine, (void *)data);
    }

}

void
PyRenderingAttributes_CloseDown()
{
    delete defaultAtts;
    defaultAtts = 0;
    delete RenderingAttributesObserver;
    RenderingAttributesObserver = 0;
}

PyMethodDef *
PyRenderingAttributes_GetMethodTable(int *nMethods)
{
    *nMethods = 1;
    return RenderingAttributesMethods;
}

bool
PyRenderingAttributes_Check(PyObject *obj)
{
    return (obj->ob_type == &RenderingAttributesType);
}

RenderingAttributes *
PyRenderingAttributes_FromPyObject(PyObject *obj)
{
    RenderingAttributesObject *obj2 = (RenderingAttributesObject *)obj;
    return obj2->data;
}

PyObject *
PyRenderingAttributes_New()
{
    return NewRenderingAttributes(0);
}

PyObject *
PyRenderingAttributes_Wrap(const RenderingAttributes *attr)
{
    return WrapRenderingAttributes(attr);
}

void
PyRenderingAttributes_SetParent(PyObject *obj, PyObject *parent)
{
    RenderingAttributesObject *obj2 = (RenderingAttributesObject *)obj;
    obj2->parent = parent;
}

void
PyRenderingAttributes_SetDefaults(const RenderingAttributes *atts)
{
    if(defaultAtts)
        delete defaultAtts;

    defaultAtts = new RenderingAttributes(*atts);
}

